package jgcp.common;

import java.io.Serializable;
import java.util.Date;
import java.util.concurrent.atomic.AtomicInteger;
/**
 * 
 * @Date: 28/05/2009
 * @author: Jie Zhao (288654)
 * @version: 1.0
 */
public class Task implements Serializable,Comparable<Task> {
	private static AtomicInteger AI = new AtomicInteger();
	public Task() {
		taskid = AI.getAndIncrement();
	}
	private int taskid = 0;
	private int groupId = -1;
	/**
	 * @return the groupId
	 */
	public int getGroupId() {
		return groupId;
	}
	/**
	 * @param groupId the groupId to set
	 */
	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}
	private int priority = 50;
	private Date deadline = null;
	private double budget = 0;
	private String file = "";
	/**
	 * @return the file
	 */
	public String getFile() {
		return file;
	}
	/**
	 * @param file the file to set
	 */
	public void setFile(String file) {
		this.file = file;
	}
	private TaskStatus status = TaskStatus.INITIALIZED;
	/**
	 * @return the status
	 */
	public TaskStatus getStatus() {
		return status;
	}
	/**
	 * @param status the status to set
	 */
	public void setStatus(TaskStatus status) {
		this.status = status;
	}
	private TaskDescription description = new TaskDescription();
	/**
	 * @return the taskid
	 */
	public int getTaskid() {
		return taskid;
	}
	/**
	 * @return the priority
	 */
	public int getPriority() {
		return priority;
	}
	/**
	 * @param priority the priority to set
	 */
	public void setPriority(int priority) {
		this.priority = priority;
	}
	/**
	 * @return the deadline
	 */
	public Date getDeadline() {
		return deadline;
	}
	/**
	 * @param deadline the deadline to set
	 */
	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}
	/**
	 * @return the budget
	 */
	public double getBudget() {
		return budget;
	}
	/**
	 * @param budget the budget to set
	 */
	public void setBudget(double budget) {
		this.budget = budget;
	}
	/**
	 * @return the description
	 */
	public TaskDescription getDescription() {
		return description;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(TaskDescription description) {
		this.description = description;
	}
public int compareTo(Task o) {
	return this.taskid - o.taskid;
}
}
